apiready = function() {
	var fid = api.pageParam;
	console.log(fid);
	api.openFrameGroup({
		name: 'previous-course',
		index: 1,
		vScrollBarEnabled: false,
		rect: {
			x: 0,
			y: 75,
			w: 'auto',
			h: 'auto',
		},
		frames: [{
				name: 'playback',
				url: 'coursePlayback.html'
			},
			{
				name: 'curriculumScoring',
				url: 'curriculumScoring.html',
				pageParam: {
					id: fid.id
				},
			},
			{
				name: 'work',
				url: 'Coursework.html'
			}
		]
	}, function(ret, err) {
		var index = ret.index;
		console.log(index);
		$(".title span").removeClass("active");
		$(".title span:eq(" + index + ")").addClass("active");
	});
};

function CoursePlayback() {
	api.setFrameGroupIndex({
		name: 'previous-course',
		index: 0,
		reload: true
	});
}

function CurriculumScoring() {
	api.setFrameGroupIndex({
		name: 'previous-course',
		index: 1,
		reload: true
	});
}

function Coursework() {
	api.setFrameGroupIndex({
		name: 'previous-course',
		index: 2,
		reload: true
	});
}